package model

import "gorm.io/plugin/soft_delete"

type User struct {
	//gorm.Model
	Name       string                `gorm:"type:varchar(255);not null;unique" json:"username" binding:"required,min=3,max=15"`
	Pwd        string                `gorm:"-" json:"pwd" binding:"required,min=3,max=15"` // 忽略本字段
	Id         int                   `gorm:"primary_key" json:"id"`
	Bir        Time                  `gorm:"column:bir" json:"bir"`
	Age        int                   `gorm:"column:age" json:"age"`
	Deleted    soft_delete.DeletedAt `json:"deleted"` // 软删除
	CreateTime Time                  `gorm:"autoCreateTime;column:create_time;type:datetime;default:null" json:"createTime"`
	UpdateTime Time                  `gorm:"autoUpdateTime;column:update_time;type:datetime;default:null" json:"updateTime"`
}
